package com.mycloud.web.controller;

import com.mycloud.dictionary.service.DictionaryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import javax.servlet.http.HttpServletRequest;

/**
 * Created by IntelliJ IDEA.
 * User: dell
 * Date: 1/2/12
 * Time: 12:28 PM
 * To change this template use File | Settings | File Templates.
 */
@Controller
public class DictionaryController {

    @Autowired
    private DictionaryService dictionaryService;

    @RequestMapping("/showDictionaryPage.cloud")
    public String echoMe(HttpServletRequest request, @RequestParam String word){

        //Masume az dictionary service estefade kon bebin age tarjomeye word tooye database hast ke hamoono estefade kon
        //age na, az farsi123 tarjomasho bekhoon va tooye database zakhire kon va ba'd tooye request setesh kon ke
        // dige khode jsp neshoonesh bede

        request.setAttribute("word", "This is the word.");
        request.setAttribute("translation", "This is the translation.");

        return "dictionaryPage";
    }
}
